{extend name="layout/layout" /}

{block name="content"}
<style>
    .areaspan{
        margin: 10px 8px auto auto;
        display: inline-block;
        border: #eee solid 1px;
        width: auto;
        padding-left: 8px;
        padding-right: 8px;
        height: 34px;
        line-height: 34px;
        text-align: center;
    }
</style>
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 添加工作人员</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form id="ajax-form" class="form-horizontal" method="post" enctype="multipart/form-data">
                    <div class="form-body">
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        所属部门
                                    </label>
                                    <div class="col-md-9">
                                        <input type="hidden" name="departmentId" value="{$departmentId}">
                                        <p class="form-control-static"> {$departmentName} </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        姓名
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" placeholder="标题名称，最多65字" id="name" maxlength="65"  data-required="1" name="p_name" value="{$data.p_name}" required>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--<div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        部门
                                    </label>
                                    <div class="col-md-9">
                                        <select class="form-control" name="departmentId">
                                            <option value="0">请选择部门</option>
                                            {foreach $departmentList as $department}
                                            <option {if $department.id==$data.departmentId}selected{/if} value="{$department.id}">{$department.name}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>-->
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        照片
                                    </label>
                                    <div class="col-md-9">
                                        <div id="upload-image">
                                            <span id="upload-btn" data-multi="false">
                                                <input type="hidden" class="form-control" id="imgUrl" data-required="1" name="p_imgUrl" value="{$data.p_imgUrl}">
                                                <img src="{$data.p_imgUrl|default='__STATIC__/admin/img/default.png'}" alt="图片上传" style="width: 100px;height: 100px;" />
                                            </span>
                                        </div>
                                        <span class="help-block"> (建议尺寸：135*90) </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        性别
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="sex" value="1" placeholder="" {if $data.sex==1}checked=""{/if}>
                                                男
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="sex" value="2" placeholder="" {if $data.sex==2}checked=""{/if}>
                                                女
                                                <span></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        职务
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" placeholder="标题名称，最多65字" id="duties" maxlength="65"  data-required="1" name="duties" value="{$data.duties}" required>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        手机号
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" placeholder="请输入手机号" id="p_phone" maxlength="65"  data-required="1" name="p_phone" value="{$data.p_phone}" required>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        学历
                                    </label>
                                    <div class="col-md-9">
                                        <select class="form-control" name="education">

                                            <option value="初中" {if $data.education=="初中"}selected{/if}>初中</option>
                                            <option value="高中" {if $data.education=="高中"}selected{/if}>高中</option>
                                            <option value="大专" {if $data.education=="大专"}selected{/if}>大专</option>
                                            <option value="本科" {if $data.education=="本科"}selected{/if}>本科</option>
                                            <option value="研究生" {if $data.education=="研究生"}selected{/if}>研究生</option>
                                            <option value="硕士" {if $data.education=="硕士"}selected{/if}>硕士</option>
                                            <option value="博士" {if $data.education=="博士"}selected{/if}>博士</option>

                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        是否为党员
                                    </label>
                                    <div class="col-md-9 isparty">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="is_partymember" value="1" {if $data.is_partymember==1}checked{/if} >
                                                是
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="is_partymember" value="0" {if $data.is_partymember==0}checked{/if}>
                                                否
                                                <span></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="party hide">
                            <div class="row">
                                <div class="col-md-9">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">
                                            入党时间
                                        </label>
                                        <div class="col-md-9">
                                            <input type="text" readonly class="form-control date-picker" name="partyTime" placeholder="请输入入党时间" value="{$data.partyTime}">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        登录帐号
                                    </label>
                                    <div class="col-md-9">
                                        <p class="form-control-static"> {$data.username} </p>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <input type="hidden" name="posttype" value="edit">
                        <input type="hidden" name="id" value="{$data.id}">
                        <hr />
                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" id="form-submit" class="btn blue save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">
<input type="hidden" class="save_url" value="{:url('admin/user/editPost')}">
{/block}

{block name="pagescript"}
<script>
    var posturl = "{:url('admin/'.strtolower($model).'/addpost')}";
    var areaturl = "{:url('admin/layer/getCounty')}";
    var villageurl = "{:url('admin/layer/getVillage')}";
</script>
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/uploadfile.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/personnel.js?v={:time()}" type="text/javascript"></script>
{/block}